Modified generic-infer to better follow the proper rules.
Cleanup.