Merge MR-34 "Do not insert duplicates into the database; UI improvements"