Minor speed and quality fix

1. Minor fix on inner block remaining value checks
2. Fixed bug that FillTemp2() will fill in x with overlapping values