Cleaned up IOManager._handle_directive().