[3.9] Add improvements to unit tests