Closes issue #1278 Closes issue #2505 Finally I make some time to review & push this change. Thanks for the patience --HG-- branch : trunk