Fix some syntax changes in error checking