fixed a load of errors