Console application has to exit with exitCode

fixes #562