Fix calculation problem