Fixes to craches