Improvements based on Sonar results.