I have attached patch for 11.x, please review
Also the issue reported in #16 ...