Further improvements to unit tests