Added setObject method that can handle setting any object, not as
efficiently as a setXXX method, but still convenient.