Fix errors with identifier in for loop and regex bool