Domain Mapping: rewrite problem with custom post types

I have a custom post type set up on the init action, which sets us rewrite rules. The problem is that if you set up a domain map, it overwrites all the custom post type rewrites. Then I have to do a flush_rewrite_rules(); to get things back to normal again.