A minor typo with the regex initialization was causing major side effects.