Proper resize handling and other cool stuff.