Discretion in judicial review proceedings