Better validation in ServeDirectory