bug fixes in fromTensor when encountering columns with all zeros