Fix nesting of ifs to be a bit more clear

Change-Id: I3845be064ec2284071eee37b8386dd20ed4af151