Minor fixes inspired by Sonar output.