Cleaned up some ASIO code and added some logging.