fix representation data, error messages and add some docstrings