Improced handling of non-ndarray inputs