Fixed some (too) long logical statements to agree with PEP8