fix calculation of variance in observe() functions