Improve $ replace logic
Rebuild packages