Add undo cleanup and fix #535 uninitialized frame data