Handling exceptions when there is zero variance