Improved loading of external scripts.