Fixing flushing and DBenv flags