Added better error detection for spurious symbols, while not caring about whitespace. Fixes 2895.
Merge origin/master