This also has the fix for bug 232, derived from the patch by Gaurav Agarwal. Also changed several lingering "linking" comments to "sync-lock", the agreed on current terminology.