Add null/undefined check on the optional names