Fix bugs and cleanup editing a light state.