Fixed some build issues for G++ 4.8.2