Ported tapkee bugfix for missed mean subtraction