Added some more statistics functions + associated tests.