(some) errors found and fixed