Partial patch to #185