merge improvements from MirBSD CVS: