fixing bugs 4565 and 4566 on Kmelia