Fixes #124 - IIFEs and 'strangely' nested functions don't produce a broken template