Added support for persisting detached empty entities (resolves #13)