Merge pull request #3 from amsross/master

Added rewrite registering and flushing on activation