Added debug variable reset code and added debug menu options.