Fix division by zero bug: screen.c:7679

*Previously #1237*

Also:
* Initialize tabwidth as 0
* Bracify if statements