Fix for issue 50

As requested, here's a pull request implementing the fix for issue #50.
While Creating the pull request, I also added PHPStorm's ".idea" configuration directory to the list of ignored directories, should anyone else use such an IDE to work on this project.