Fix some warnings; improve the stdio emulation.

21 files changed