Changed handling of toSeq to match changes in the base package.