change counter type to unsigned
change converter procedures to directly return data and size and remove returning of a context