Bug fixes

Had to remove some of the speed enhancements to trade off for stabilty.