Add set type

This PR adds sane object handling.
See above.