Fixes for general expectation computation.

Fixing the normalization of the reference state for the expectations.