Apply some optimizations & fix lnotab.