Fix database size bug