Fixed some type inference problems.