script parsing: fix bug in expression error checking