Properly handle size_t and uint64_t

Fix for the size issue I logged, I believe it's the correct way to fix it.