Remove more warnings when g++ is used

This PR is just for removing warnings from g++ compiler.