Patchs for code quality
Failed tests fixed