Modification of sdsern's patch to address radix's review comments