Fix SQL injection issues