Fix undefined bug in setAtIndex and adding the version