Fix bug not grabbing corresponding script snippet properly.