bug fix from upstream (svn)