Fix bug with erasing of layer's invisible items