Fixed nasty bugs in lighting algo

Seems perfectly fine now!