Replace nil values with empty strings

As discussed in #402