Changed diagnostic library to take dynamic parameters.