Fixed bug in type inference.