Fix handling of QVariants and user types as return values