Documentation and bug fixes