This code block is very confusing for someone who doesn't know about the issue. There should be a comment explaining it.