Updated management command to use proper exit code on failure.