A bunch of bugfixes and patches relating to the clang static analyzer