changed attr parser to better handle malformed strings