Fixed bugs: uninitialized bool for main loop