Several changes in main.vi