Change/later ycheck

Moved -Ycheck to just before erasure. Lots of fixes to make that happen. Review by @DarkDimius