Fixed errors in main script for integrated model