[TP] last fixes, SM logout, DEVs state after SM login