remove some unused imports, make sure indices are integers