clang 3.3 compatibility and gcc warning fixes