Fix command return status on error