added better error message for parser
fix various parsing issues