Fix for indexing issue with related sets on inser()