Fixing zero variance case