Fix yet another batch of stupid issues, adding debug stuff