Add some more type inference code