Fixed logging for commands which may fail