Some fixes and MultiThread test base