Fixed bug with n statistic and index caching, moved towards Python 3.4 compliance