fixes for Regex implementation