various fixes to testing code