Added checks of exit codes
Restrict access to private key