made to compile with clang 3.3
improved compiling with gcc4.8