Bug fix. Tests refactoring