fix error when removing all terms of a taxonomy (ref: #445)