Fix wrong condition for native error checking.