Fix OSX build
Fix error output bug when error is at end of line