Adjusted error handling of commands.