Fix indexing to work on import