Fix edge case for even number of unbalanced braces
Ignore only hash refs on lines that start with a #