fix a wrong range clip
fix names to keep consistent of style
improve UT to cover more cases under GetStatistics
Merge pull request #1451 from sijchen/for_format

Fixes and change naming