Backport #625

I don't get the reason for the CS changes in this method. Should be reverted IMO.