protect against modulo zero, and negative tab size