Add some validation and fix options passing on server