Bug fix: set/unset causing inaccurate results under some conditions.