To my knowledge, [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) has not been run on this code yet. It could bring valuable insight and help fix problems harder to detect by hand.