fixed ed warnings (mostly too few checks)