Changed uint32_t to size_t

 - changed uint32_t types to size_t to avoid overflows