Fix stats and improve performance