Minor bug fix: internal keyCache wasn't properly cleared when the database was cleared