clang 4.1 fixups

remove casts to keep clang 4.1 happy on
Mac OS X. Now produces a number of warnings
on clang 4.0.

Fixes #420