Fixes for gcc 4.8/4.9