Some code fixes to improve test score