Don't require the task identifier to be an integer.
Temporary fix for hash code collisions: print the term to a string and take the hash code of that.