Fix a few off-by-one errors and add diffability flag to spec tests