Some small fixes related to IO.