A bit more sqlite cleanup