Woot! It's actually generating queries like it's supposed to! Except for the "AND" word between WHERE clauses, that is.