Fixed bug - when treaty is not tagged with any term, SQL error is thrown