Don't return cols = 0 [Fixes #1267]

It just causes zero division errors.