fixes for g++-4.8 and clang 3.3 errors