Fixed compile errors for gcc