GRIM: Make PatchR error messages more clear
(cherry picked from commit 42ffa2a0c2a2a5e14be48f182a5545778c99cb4f)
GRIM: Add some additional checks in PatchR
(cherry picked from commit e0c086caabb430d7aa3bd7292ac6a715200da699)