Fixed several SQL injection vulnerabilities