Fix brightness function