Tweaks to source elements and removing redundant scriptCode attributes