Maybe you could try to backport the last commit from pull/584. I'm not sure if there are some conflicts with 2.1 branch though.