[patch] bug fixes and documentation improvements by Greg Alexander