when changing type with the console, elementCount / pmap stay updated and elements are initialized / deleted properly

Also, partially fix strange DMG crash and fix CELL long border around the edges