Adding support for general R objects