Minor fixes to tests. Added ConsistencyError.
Raised when internal indexes are currupted.