Fixes Lights behaviour and adds tests