Backport #281 fix