Apply Julian's proposed fix to AF crashes.