Figthing with weird type-inference issues; tests work, but the type-members in index types are in a mess