Revert "Revert "Merge pull request #1061 from icylace/master""

This reverts commit dc74e3ba08d4dd85e117000ca12ced82120d67f9.