Further optimizations and copy/paste fixes

I think this is everything on the 14.6 algo/optimization and fixes
with this you should be able to close issue #320