fixes to index offset