Fixed the subresource calculation.