timob-12176: fix various bugs.