Return exit code

Fixes #439
I would put that in the if(errors.length) few lines up. just to mirror the one in the else