Fix the use case of multiple inlinings of a given function, and add tests.