R: avoid copying attributes in query functions and print (#573).