Fixes duplicate local DB records

Also some minor JQuery call reduction