Fix crash and assembly translation in debugger + refactoring