Finally fixed a bunch of stupid errors.