added some invalidation tests. fixed doctest failure