Final tweaks to native code