Fixed issues with script loading