Fix for bad index