Fix issue with extra scripts in layout