fixed index handling so no manual error checking on dev side
Merge pull request #31 from mrb/index-fix

Fixed Index Handling