Added in a missing assert and cleaned up some code in coarse.c