Support NUCCORE-1238. Make wrappers genericised and fix one problem that
showed up.