Make sure that indexes are set

fixes #2