try to issue better exit codes. still not perfect.