Fix some Linux portability bugs
libstdc++ and GCC compatibility