Applying changes from my last commit to the EFCache fork.