Fixed some bugs and teacher index