Some security fixes to stop possible XSS attacks, closes #36