Upgrade to stdlib 40