Bug fixes and documentation updates