small bug fix to design_matrix/write