Fix stack overflow caused by cached EF metadata