Fix some type errors