revise uses of num chunks
fixed int type
fixed type in comparison