Fix layouts so scripts go at the end of the page