fix constband out of range
code cleanup