Fix 'trim' of undefined

A test was failing. This ensures we have a string to call trim() on.