HGEN tweaks. As optimised as I can make it without using my brain or a significant re-write.