Fix unbalanced sub definition