Fixed initialization of totalCredits field