Fixed ME API changes.
Fixed some replacement issues.