Fix syntax checking in UTF-8 mode