fixed the stat issue. all unit tests pass.