Fixed gcc complaining about narrowing type