Bug fix to order of JavaScript inclusion