Various cleanup. Improved docs.