Changed regular expression  and other minor fixes.