Fixed mean not being calculated during training