Fix try/catch outside loop causing some commands to erroneously succeed