Fixes potential issues. Improves regex formatting