KER-253: Fixed the last bugs found