Fixes to test lib