removing call to setblocking(1) seemed to cause sequences to stop working correctly, so I am replacing it and investigating why this happened. It is unclear why this is.