Fix uninstall and some small bugs

This should be final version ready for release.