Final bug fixes and documentation