Added support for Microsoft PDW. Fixed a bug in the translation routine when replacement is of length zero.