fixed the query and deleteTuple functions in database

the fixLiterals() function needs to be fixed still though. As of right
now, this function call is commented out in query and deleteTuple.