Looking down in ri_PerformCheck(), I see there may be case where error fromSPI_execute_snapshot() would skip restoring UID.
Please look at patch v2 which tried to handle such case.
Thanks