Replaced preg_replace() with preg_replace_callback() in Connection.php