@@ -349,8 +349,8 @@ replaceSplits l ups impossible
349 updatePat start n tm (c:rest) = c : updatePat (not ((isAlphaNum c) || c == '_')) n tm rest
349 updatePat start n tm (c:rest) = c : updatePat (not ((isAlphaNum c) || c == '_')) n tm rest
351 addBrackets tm | ' ' `elem` tm
351 addBrackets tm | ' ' `elem` tm
352− , not (isPrefixOf "(" tm)
352+ , not (isPrefixOf "(" tm && isSuffixOf ")" tm)
353− , not (isSuffixOf ")" tm) = "(" ++ tm ++ ")"
353+ = "(" ++ tm ++ ")"
354 | otherwise = tm
354 | otherwise = tm