Fix unit array comparisons

The previous code inconsistently treated plain floats and ndarrays. This rationalizes the two.

Can someone that uses this code in applications give this PR a spin?