Improved syntax checking.
Added another test.