Fixed pointless nested ifs