Merge pull request #179 from mdevaev/master

Fixed descriptors leak + minor issues