Statistics, db update fixes