Fixed gcc build errors