various fixes for gcc