A couple bug fixes and documentation improvements