Changed exit codes to properly reflect errors