Repair bug

When the total post is less than a number, the random sample wont work
And also monger will return long as double, need to force coerce to long