Fix two divide-by-zero errors in the tile() layout function.