Most errors fixed