made various fixes