Apply a couple of patches from upstream git that resolve crashes when ID mapping object was not initialized properly but needed later