MODE-1974 Corrected RepositoryStatistics

Made several corrections and improvements to the RepositoryStatistics
functionality, though most of the changes are for tests. Verified the
fix by running a test for 65 minutes (this test method is @Ingore'd
and will not run during any of the builds) and getting the same
windows as reported in the issue.
MODE-1961 Corrected compiler warnings from previous MODE-1961 commit