Preventing foreach-errors

Loops calling "extra_tabs" as an array is prevented with an
if-statement.
Merge pull request #9 from EkAndreas/master

Preventing foreach-errors