Major improvements to console mode.
Fix to sendfile mode