Fix shared buffer issue in the repr code