fix compiler errors on gcc