Improve error handling in the parser. Use Error instead of fail when possible.