Oh, I didn't see this patch before... anyway along with all the minor whitespace,etc problems, there are two big issues: 1) this patch needs to be _before_ the previous 2/3 patch (or else the intermediate state is buggy) and 2) you need a GID cache too.