Fixed a lot of stupid bugs!