Handle MEMORY_NOT_INITIALIZED in various switch-cases, and throw an informative exception