Fix division by zero in shadow rendering