Fix multi-instance issues.