Multiple changes to support multisite installation