Thought about my fix (previous commit), and came up with a faster
solution.