Add move undoing capability.
Fix build errors.