waitFor improvement
Other changes