Correct name assignment in __repr__; clearer if statement; add ndarray test