Correctly set the empty value depending on the DB field (fixes #6550, #6544)