Added more tests; isolated sparse batching bug.