Backport patch for #65 to 1.3 stable branch