Fix code that generates E_NOTICE's

The client issues notices when `$data->tagType` is empty, which occurs from time to time. This PR fixes this by setting the values only when `$data->tagType` contains data.