Setting proper exit codes