Fixed typo error when checking for g++, some minor fixes also