Fix atrocious code.

Can we still be friends?