Fix my_index bug and some style problem