Add virtual host test and fix virtual host bug