Properly restore gDebug value, fix segfault for gDebug > 3

in readRootmapFile.