This took a bit to wrap my head around, but it should be resolved now. There were two sections of code that were skipping themselves because they both expected the other one to create langgroupid. The error and new data inconsistencies that would have been caused will be fixed in the next build. However, fixing entries that were created while this error occurred requires an extra upgrade step in 4.0.16.