See above on `elem` being fine instead of `$(elem)`.