- implement #313 by hand due to git merge failures.