Fix `iostub` and add some comments