add tryReadUntil and make fixes along the way