Fix auto resize behavior