fix build in clang
fix header guard typos
fix stringstream behavior for NaN output in newer compilers