Inverted a few ifs.