Bug fixes and updated documentation