Bug fixes for using Entity Framework as a persistence source.