Fixed bug on QOH calculation