Merge pull request #30 from Supermathie/fix-hang