Correction of bugs
Refactored tests