bugfix : Kirc.rewrite must handle pattern matching