some fixes for gcc compilation