Fixed many test crashes.