fix various issues