More safety checks before setting light direction. See #344.