memory allocation bugfix (uint -> size_t)