Fixed a few bugs
Changed regex ifs slightly