Small fixes of code duplications