Fixed dependency issues when deleting quantities