Added index drawing method and fixed a few errors in related places