Changed len to uint32_t from int