Fixed issues with preg_replace.

Fixed issues with perfectly good code because someone decided
preg_replace shouldn't use the e parameter anymore.