Simplify apostrophe error check