Regexp bugs fixed