first wave of fixes to runtime errors