Recovery of metals in waste