fixed regex, and various small bugs
Merge pull request #13 from ArthurGibbs/regexbugfixes

fixed regex, and various small bugs