Changed logical comparison to be more standards compliant