Repaired nested ifs after running PMD.