Make compatible with 32-bit architectures

I had accidentally used unsigned long int's a few places where it should be size_t