Fixed function comparison bug