Fix resize bug from loadState.