Correct bugs checking return value of 'command' calls