Fixed bug in replaceAtPos

Oskar, Erik, Adil. 15 min