Fix possible getLightValue() crashes.