Some minor bug fixes and documentation changes