gcc compatibility fixes