Properly open and close the streams.
Pretty-print needn't be optional.
Temporary workaround for #3.