Changed cleanupURL() logic. Made 'a' & 'script' openable.