Added __replace instruction to template scripts. Improved __move instruction.