Fixed the dyamnic layout function in packrat.js to initialize when loading documents. This may become inefficent in the long run, but this will force proper layout when the page first loads. Kepp an eye on this so as to make sure it doesn't take up too many resources in the future.