Added missing brightness check (plus cleanup)