fixed whitespace detection
improved parser error messages