fixed failure on metadata category with spaces

this fixes #765
Merge pull request #879 from gregcaporaso/issue-765

fixed failure on metadata category with spaces