Bug fixes and xss protections