Fixed a shit-ton of stupid bugs