Updated to test for strings before using them.

  This updates #182.