Improved and fixed statistical tests.