Tweaks to debug output of SQL queries to replace '@' prefix