Bug fixes

Moved to last hook.
Bug fixes in resizing.
Bug fixes in toolbar placement.
Bug fixes in menu placement.