Corrected code from PMD advices.