Tidy up variable name output

.. there were cases where 0 was being appended
to things that were not arrays. Don't do this.