Fix duplicate entry issues