Fixed ordering of head scripts in layout