Added -run-wait feature.