[TIMOB-13183] Small bug fixes and code cleanup
Manual cherry-pick
[TIMOB-13183] Updated the changelog