Fix qualiy flaws