Fix exit code when invalid