Fix setId function to recognize null ids properly.