forked from: Vector index casting

