Merge pull request #2 from sinvalmendes/master

Merge done
Fixing some mistakes in the tests and in the respective implementation.