Fixed minor errors for g++ build