Trim default buffer size, was too huge.
Use bracket to close resources.
Display stats when closing.