GCC 4.9 fix-ups
from flar2's git