Fix build warnings from gcc 4.8

duplication of #833