Better approach to zero variance issue (fixes #14)