fixed gcc compile errors