some fixes for clang-3.5 compatibility