database queries needed enclosing quotes

The queries on lines 493 and 506 pass a text argument without enclosing
quotes.  The patch adds the missing quotes.