MOAR bugfixes. Some bit cleanup