re#20 Database is now cleared when refreshing plans. This fixes duplication issue