If you can share any extra details (like specifically what you were doing before the crash), that may be helpful.
For the "selectedItem" variable, I've made it so it will properly clear after exiting a shop or starting a new game (or loading a save file). Hopefully this will help with any...