Fixed hardcoded length in boson expectation value