Merged fixes of Bogdan  with main branch