Fixed bug when updating lines after freezing a piece and optimized it.