Fixed deadlock when opening edit UI + other fixes