Check that terms are an object, not an array

We've moved to storing terms as an object, not an array.