Adds functionality for set-nth.

Issue #578 
just using

    i == index

should work as index is supposed to the the index of the array also counting from zero.