Fixed a massive bug that would pretty much permanently break everything.