Tested, fixes for clang