Okay, I believe I finally found it. I was fixing the wrong problem before, it needed to be fixed or the two databases could be out of sync, but it apparently wasn't causing our crash. I restructured the code(again) and was able to catch the condition of the segfault, it's a NULL pointer...