fix important bug + added test
Merge pull request #642 from georgebyelas/master

fix important and nasty bug + added test
changed docs
Merge pull request #643 from georgebyelas/master

changed docs