Fixes to allow compilation on older versions of gcc