Fixed daylight sensor unpowering

* Fixes #1094
Fixed bad comparison crash

* Fixes #1095