#15 System hangs on shutting down terminal after program end.

Fixes #15