Fix marks calculations errors