Tried to make light discovery more robust.