Fixed issue with state element edit box still displaying deleted elements' details.