Fixed embed detection by a LOT and now also only replacing the relevant bits