fix compiler warnings using dubious casts.