Major bug fix. I'm bad.