Fix resize bugs