backport couple of fixes from devel