Fix calculation for whether display is empty or not