Fixes #4. Not fully tested but fixes everything I've found so far.
Merge pull request #7 from minioak/2.2/develop

Fixes #4. Not fully tested but fixes everything I've found so far.