Fixing write to support non-blocking.
Comment out extra logging.