Fix some warnings

Fix some type warnings. Also silence silly gcc (clang) warnings on OS X.