Now added chip erase before programming, and locking after.