fixed various issues.