Fix implicit casts to satisfy compiler warnings