Much better fix for #1