clean up parseTags and handle non-string values