Minor improvements according to recommendations from Sonar.