Sanitize the value of COLUMNS passed to terminal_width
Catch TypeError in case COLUMNS is empty
Fix typo in _write_with_fallback
Minor pep8 issues
Merge pull request #1291 from Xarthisius/console_fix

Sanitize the value of COLUMNS passed to terminal_width