Fix some quality flaws
Fix stability of test