Code tweaks from running PMD.