Fixing weird path dependent type problem