Fixed rollback logic and some tests. Add some TableManager tests.