fixed various problems