Fix gcc compile errors