grains: add test for 0 case

Also corrected a missing output error message in a test