Fix bug with unsaved entities