fixes various issues