Changed ui.display() to use sys.stdout.