fix some type errors (shame on you compiler!)