handle exit codes too (fixes #12)