Fixed resize bugs.