Fixed emergency bug fix

Lol, the patch broke things even more.

All is fixed now. I should not try to fix bugs while tired.