Fixed cases where we were only comparing the tag name, and not the entire previous predicate (See test)

Also fix some issues with the last commit