Added back in some of the stuff I accidentally reverted.