Proper exit code on error