Adds db->flush_cache() to try and fix weird SQL OOP issue (Issue #18).