Many errors fixed