fixed gcc compatibility problems