Fix atrocious code.