Change wait functions.
Minor fixes.