Remove unnecessary casts and avoid some warnings with gcc 4.2.