improve optim pkg tests