Simplify comparison following comments by @taldcroft, add additional tests