Thanks you all for your advice, I've updated the patch based on your feedback (also for the recent changes in master).