[MRG] fix type warnings

Attempt to fix most of the warnings when compiling with Clang.