Fixed console to exit properly, wasn't finished frankly.

Script now exits as expected.