Saving locations as terms so they can be queried more quickly. Various fixes.