Slightly improve dialog logic
Fix and simplify dialog logic