Replace sqlite3:for-each-row with sqlite3:first-result where it makes sense