Fixed clean exit on interrupt with gui loop.