Merge pull request #34 from davidw/master

Fix finalization bug and add stop_and_wait function
Add dialyzer make target.