Cast sizes to int before resizing