BUGFIX: Escaping input for use in SQL query.