Fix writing dat files out.

Woops.  Turns out that was writing one byte when I need four.