Correct some errors
Lots of changes