XSS and Bug fixes