Added isinstance(metadata, str) check before running encode on metadata. Closes #134

Closes #134

Check that ```metadata``` is in fact a string before running encode on it.