CORE-5773: fixed a couple bugs