Fixed SCI-1242 broken test and improved usage of dataset iterators