Fix grainId to be 22 characters in `restoreGrain`