I should have learned to use asserts to prevent bugs by now...