Fix crashes on some devices and attempt to fix flashlight turning on then off immediately

Not sure if flashlight is fixed as this has not been reproduced... Will
issue a test build later, for now please email me if this works for you
when it didn't work before...