Fix a bug. Turns out this doesn't improve performance so much; still, the code is cleaner