Add reject function, and fix some regexps.