When you add a panel in code, and then move to the new panel, the size of the box (height) is wrong. It is as the size of the box after the one you just added.
To see it, use the demo. Remove all the panels (first one will remain). Then add a new one, and switch to it. If the added panel is larger than the current one, the height of the box will be smaller than it should.
Great plugin, btw!