Updated tag creation code to use blank values for edge cases