Changed some re-write rules