Fix a type mismatch regression from commit b374e65ea7d10694d7037e7c47249c65ae21616c.
Add basic verification to input, strip out needed data using Regex extension.