fixed failure on metadata category with spaces

this fixes #765