fixed input validation, added a couple of more tests, added vhost setting support