Adds functionality for set-nth.

Issue #578 
Please remove `oor` since it is unused.