small fixes to output (stderr) and exit codes