merge several smaller fixes