Revert "Rebasing changes from npl svn repo onto opl"

This reverts commit ec0b650868b14ae772f4b254f433ab7d2089f49c.
Adding missed fixes/probs from npl rebase