fix gcc compile errors