Fixes for gcc4.4 and newer compilers