Corrected issue with using preg_replace with a $pattern array

See issue #18