Fixed some bugs in StratifiedForward and better test coverage.