Fixes for gcc3 and newer compilers