Improve stability of grid resize