Improved checking of service_code.