Resizing and bug fixes