Merge pull request #13 from gaillard/master

approximate wait param and loop exit.