Fixed parse errors

Fixed parsing newline problem, added tests to check for that.
Fixed parsing unbalanced parentheses