Worked around another hang. The result is terribly ugly, but it'll have to do for now.