fixes to testing code