Changes to startup and erase code