Silence some Windows compiler warnings

by adding explicit type casts.