fix a multisite issue and a reference issue.