Fix range bug

Accidentally wasn't removing the final line needed to remove all the
empty lines