Use more canonical way to prevent io_server stops.
Fix possible nullref.