a few bug fixes for multihost support