enxure nested curly braces function properly

Seems I had the logic inverted for nested curly handling.  This fixes
issue #46.