fix errors caught by gcc 4.8