Fix self-referential scripts