Clang compilation bugfixs