Fix empty div causing exception