Fixed most errors