some fixes to crashes