Fix insert/set item functionality