Fix clang and g++4.7 issues