Bug fix

Fixed bug that was causing odd spacing in header files and occasionally
causing conversions to fail. Also added in additional measures to ensure
daysimeter headers are fully written, without garbage bytes.