Fix compilation for NAG solver