SQL errors were caused by escapeField() usage in TreeBehavior. Quoted fields were not correctly unquoted. Fixes #3491