Bug fixes and some documentation.