Added 'autoscript' generation support and other minor changes.