Various fixes to testing