Fixed unfilled parameter in preg_replace definition, corrected throws

See issue #18