more errors found and fixed