Documentation and bug fixing