Use int type for index option for #667

Fix #667