Some of this is redundant with respect to the invariance tests, notably `copy` behaviour and `nan` checking.