Timur, in comments #5 and #6 I describe a couple of alternative methods to fix this but they would be significant amounts of work, even though they would be cleaner (I don't know about "elegant" though :)
Timur, in comments #5 and #6 I describe a couple of alternative methods to fix this but they would be significant amounts of work, even though they would be cleaner (I don't know about "elegant" though :)