sam: fix return code for sub-commands
close #208