Attempted to fix bugs seen with sparse_test_class()