Fix for null sg code.