Fixed error in resource calculation.