propagated Alex's fixes from the MonetDB_4-4-0 branch to the main branch
propagated Alex's fixes
from the MonetDB_4-4-0 branch to the main branch

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb