Thanks all, I've pushed these patches to master as 560062aaeabb485e7f53f8f5e6449b9a35aa9ca2. Chris