backports from Dusan, added to CVS