Fixes issue #12

Contents are moved as per scope grouping but scripts are no longer
broken as a result.