Removed testing message. Sent error to stderr. Added correct exit codes