Improving error messages and cleaning up parser
Improving error message