RF-13087, RF-13010: Fixes corner cases missed in the original fix of RF-12850