Fix regex and renamed variable