Add 'lazy' to two parameters to let the constructor runs first and set the application name properly before they are used. Without this, the command line options are sometimes ignored.

One test had to change, as it assumed the port number would have been set,
when the method was never called.  Calling the method to get the port number
fixes this, by allowing the lazy method to actually be run before the value
is used.