Fixed issue with errors on position field on broken templates

When a template's xml cannot be found or has errors, the foreach loop throws an error (because $positions will be 'false' and not an empty array).
This should fix that. It will also prevent templates showing up in the list that have no positions.