Avoid possible handler leaks
Merge pull request #403 from ozbek/master

Avoid possible handler leaks