Restore __repr__ method and modify unittests