Slowed down light sensor, fixed some bugs