fixing warnings from erasure() method