Fix for 'Only variables should be passed by reference'

Fix for 'Only variables should be passed by reference' which would occur with tags that were not closed.