clear screen before connecting to console or monitor.

clear screen before connecting to console or monitor.
fix minor bugs

additional unset varialbes