Fix unicode arguments in query, fix returning empty result sets
Small optimization: use generated row_id instead of reading the item's row_id and substracting 1