Gracefully handle factors.
Fixed cached table bug and updated first example to be simpler.