Bug (program does not stop after window close) fixed.