Bug fix: Wrong ranges for list sorting of intermediates.