Improved light control and added logging.