Add isset validation to most ifs