bugfix from other branch

this branch was missing an earlier bugfix, but repatched here as do not want
to muck about with merge conflicts just yet.