renameInstruction fixed; addInstruction made idempotent