Apply proposal 121 patch 3, with minor tweaks and a few comments.