fixed various problems.