Fixed compile index bug
Closes #1