Fix 2 crashes