use -1 for exit_code default
refactor exit status handling
tweak log statement
fix spec