For more generalisation, the default parameter values are now handled by
cdist instead of trying to get a value and use a default if parameter is
not given.
It handles the default values in a more general way, instead of write
one default in (possibly) multiple places.
Problem occurred when checking the 'state' parameter, which required to
set a default value in two places.