While reviewing the patch myself, i spotted some formatting problems in the code. Fixed in this v5 patch.
Also, this patch uses context patch format (in first versions, because of the small modification, context patch format obfucates the changes. After reimplementation this isn't the case anymore)