Fix some type inference problems.