Little changes to better support nonblocking I/O