Fixes #161, previous one was all wrong.

Reverted changes from previous commit and made the necessary fix.