[BUGFIX] Repository replace() does not replace unpersisted objects