Merge pull request #12 from oliora/master

Fixed Windows compilation errors and memory leak
Merge pull request #13 from oliora/master

Fixed typo added in previous commit
Rolling back changes made by mistake.