Tests refactoring; Minor fixes; Code inspection;