Backport #267