Build fixes for recent versions of gcc