fix index casting to Uint64 (julia convention)