Fix related to #321 that handles NULL values instead of inserting the string NULL into the DB