Fix some error checking conditionals