BAMPFA-271: Fix js errors when returning to advanced search with dynamic term lists.