Fix bug #2

As declared, if you merge this pull request, you can safely close bug report #2 since this is the actual code suggested in that bug pulll-requested