Script improved. Funny debug output removed.