Patch for #291
Merge the patch for #291