Changed resize conflict-resolution logic. I think it's more robust now.