Fixed error handling.
Fixed mismatched parentheses.