Bugfix for non-default dof_id_type sizes

Caught this bug with a 2 byte dof_id_type; since it doesn't look like it will affect the 8 byte case fixing it is a low priority.  I'll give others a few days to test if they wish before I merge.