fix a bug where wrong NA types were added to opt.path