Fixes to process handling and error output