More work on sys_rewrite