Fix bugs caught by UT
Merge remote-tracking branch 'origin/sto635' into handlers_ut
UT to cover missing case for sto635