Allow DW gradient encodings that have fewer than 7 rows

As discussed in #61.