Fix crash due to empty regid