Fixed bug with resource consumption