Fixed a regex bugs.