Fix bug with ulong/uint/size_t mismatch.

This failed to compile as 32-bit with DMD (error on lines 1244 and 1255 with "cannot implicitly convert expression (length) of type ulong to uint." The .length property of arrays is size_t, so the length variable should be declared as such.