fixed bug in inversion: the type of abstractions was not being properly inverted