Fix some arithmetical errors.
Use correct assertions on tests.
Merge pull request #441 from rodrigorm/sigmoid-error

Fix some arithmetical errors