Several upgrades, inprovements, and refactorings
Small doc error