fix compilation for gcc 4.8 & some unit test