Fix tests when run in parallel