Fix bug in deepExtend that modifies extended machine.