Stupid bug

I should have tested this code more throroughly...