fix various bugs in testing