Add flatEntropy and correct some missing checks